package com.interclass;

public class OutClass {
	private int age;
	
	public OutClass(int age){
		this.age = age;
		
		InterClass interClass = new InterClass();
		InterClass interClass2 = this.new InterClass(); //实例化内部类
		interClass.display();
	}
	
	public class InterClass{
		private int age = 12;
		public void display(){
			System.out.println(OutClass.this.age); //访问外部类的成员 //OutClass.this.age
		}
	}
	
	public static void main(String[] args){
		OutClass outlass = new OutClass(222);
		
		OutClass.InterClass cc = outlass.new InterClass();
		
		System.out.println(cc.age);
		
	}

}
